<?php


namespace app\admin\controller;


use think\Controller;

class Order extends Controller
{

    //订单列表
    public function lst(){
        $admin=session('admin');
        if(empty($admin)){
            $this->error('您未登录，不能进去后台管理','/admin/index/login');
        }
        $orders=db('order')->alias('a')->field('a.*,b.name')->join('user b','a.user_id=b.id')->paginate(2);
        $this->assign('orders',$orders);
        return view('list');
    }


    //发货
    public function sendgoodsajax(){
        
        if (request()->isAjax()){
            db('order')->where('id',input('post.id'))->update(['is_send'=>1]);
            echo 1;
        }
    }

}